package com.example.demo.model;

import com.example.demo.entity.CopyrightTransferEntity;
import java.io.Serializable;
import java.util.Date;

/**
 * 版权转让信息模型类
 */
public class CopyrightTransferInfo implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    // 记录ID
    private Long id;
    
    // 版权ID（数据库ID）
    private Long copyrightId;
    
    // 区块链版权ID
    private String blockchainId;
    
    // 转让方地址
    private String fromAddress;
    
    // 接收方地址
    private String toAddress;
    
    // 转让时间
    private Date transferTime;
    
    // 交易哈希
    private String txHash;
    
    // 状态：0-进行中，1-成功，2-失败
    private Integer status;
    
    // 备注信息
    private String remarks;
    
    // 关联的版权信息
    private CopyrightInfo copyrightInfo;
    
    // 静态工厂方法，从实体创建信息对象
    public static CopyrightTransferInfo fromEntity(CopyrightTransferEntity entity) {
        if (entity == null) {
            return null;
        }
        
        CopyrightTransferInfo info = new CopyrightTransferInfo();
        info.setId(entity.getId());
        info.setCopyrightId(entity.getCopyrightId());
        info.setFromAddress(entity.getFromAddress());
        info.setToAddress(entity.getToAddress());
        info.setTransferTime(entity.getTransferTime());
        info.setTxHash(entity.getTxHash());
        info.setStatus(entity.getStatus());
        info.setRemarks(entity.getRemarks());
        
        return info;
    }
    
    // 构造函数
    public CopyrightTransferInfo() {
    }
    
    // Getters 和 Setters
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getCopyrightId() {
        return copyrightId;
    }
    
    public void setCopyrightId(Long copyrightId) {
        this.copyrightId = copyrightId;
    }
    
    public String getBlockchainId() {
        return blockchainId;
    }
    
    public void setBlockchainId(String blockchainId) {
        this.blockchainId = blockchainId;
    }
    
    public String getFromAddress() {
        return fromAddress;
    }
    
    public void setFromAddress(String fromAddress) {
        this.fromAddress = fromAddress;
    }
    
    public String getToAddress() {
        return toAddress;
    }
    
    public void setToAddress(String toAddress) {
        this.toAddress = toAddress;
    }
    
    public Date getTransferTime() {
        return transferTime;
    }
    
    public void setTransferTime(Date transferTime) {
        this.transferTime = transferTime;
    }
    
    public String getTxHash() {
        return txHash;
    }
    
    public void setTxHash(String txHash) {
        this.txHash = txHash;
    }
    
    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public String getRemarks() {
        return remarks;
    }
    
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
    
    public CopyrightInfo getCopyrightInfo() {
        return copyrightInfo;
    }
    
    public void setCopyrightInfo(CopyrightInfo copyrightInfo) {
        this.copyrightInfo = copyrightInfo;
    }
} 